package collection;

import java.util.*;

public class SortString {
    public static void main(String[] args) {
        List<String> list = new ArrayList<>();
        list.add("jack");
        list.add("rose");
        list.add("tom");
        list.add("jerry");
        list.add("black");
        list.add("Kobe");
        System.out.println(list);
        Collections.sort(list);
        System.out.println(list);

        Collections.sort(list,  (o1,o2) -> o1.length()-o2.length());

        System.out.println(list);
    }
}
